<template>
  <tr>
      <td><input type="checkbox" v-model="obj['checked']"></td>
      <td>{{obj['name']}}</td>
      <td>{{obj['price']}}</td>
      <td>
          <button @click="sub(index)">-</button>
          <span>{{obj['num']}}</span>
          <button @click="add(index)">+</button>
      </td>
      <td>{{obj['price']*obj['num']}}</td>
      <td><button @click="del(index)">删除</button></td>
  </tr>
</template>

<script>
export default {
    props:['obj','index'],
    methods:{
        add(index){
            this.$emit('addCount',index)
        },
        sub(index){
            this.$emit('delCount',index)
        },
        del(index){
            this.$emit('delTr',index)
        }
    }
}
</script>

<style>

</style>